#include "directSort4.h"

void InsertionSort(ElementType A[], int N)
{
    if (N == 0 || N == 1)
        return;
    int i, j;
    ElementType tmp;
    for (i = 1; i < N; i++)
    {
        tmp = A[i];
        for (j = i; j > 0 && A[j - 1] > tmp; j--)
            A[j] = A[j - 1];
        A[j] = tmp;
    }
    return;
}